package com.suray.attendance.model.enums.erp;

/**
 * Description: 维护领料申请单的单据类型对应枚举类
 * Author: linyu
 * Date: 2023/11/17
 */
public enum IssueReceiptReqDocTypeCodeEnum {

    安徽生产厂内领料申请单("5D40"),
    安徽生产重工工单超领申请单("5D43"),
    安徽生产委外领料申请单("5D41"),
    安徽机电厂内领料申请单("5D80"),
    安徽机电重工工单超领申请单("5D82"),
    安徽机电委外领料申请单("5D81");

    private String docTypeCode;

    IssueReceiptReqDocTypeCodeEnum(String docTypeCode) {
        this.docTypeCode = docTypeCode;
    }

    public String getDocTypeCode() {
        return docTypeCode;
    }

    public void setDocTypeCode(String docTypeCode) {
        this.docTypeCode = docTypeCode;
    }

    public static String getDocTypeCodeByDocTypeName(String docTypeName) { // TODO 映射关系  docTypeName = 维护工单信息的 plant_name+doc_type_name
        IssueReceiptReqDocTypeCodeEnum arrObj[] = IssueReceiptReqDocTypeCodeEnum.values();
        for (IssueReceiptReqDocTypeCodeEnum obj : arrObj) {
            if (obj.name().contains(docTypeName.substring(0,6))) {
                return obj.getDocTypeCode();
            }
        }
        return "";
    }

}
